package com.axend.aerosense.room.ui.adapter;

import androidx.annotation.NonNull;

import com.axend.aerosense.common.bean.RadarBean;
import com.axend.aerosense.common.bean.RadarType;
import com.axend.aerosense.room.R;
import com.axend.aerosense.room.databinding.RoomLayoutDeviceCardItemBinding;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;

public class RoomDeviceCardAdapter
        extends BaseQuickAdapter<RadarBean, BaseDataBindingHolder<RoomLayoutDeviceCardItemBinding>> {

    public RoomDeviceCardAdapter() {
        super(R.layout.room_layout_device_card_item);
    }

    @Override
    protected void convert(@NonNull BaseDataBindingHolder<RoomLayoutDeviceCardItemBinding> baseBindingHolder, RadarBean radarBean) {
        RoomLayoutDeviceCardItemBinding binding = baseBindingHolder.getDataBinding();
        binding.roomDeviceImg.setImageResource(radarBean.getType().getImageRes());
//        if (radarBean.getType() == RadarType.ASSURE){
//            binding.roomDeviceImg.setImageResource(R.mipmap.common_assure_icon);
//        }else if (radarBean.getType() == RadarType.WAVVE){
//            binding.roomDeviceImg.setImageResource(R.mipmap.common_wavve_icon);
//        }
    }
}
